/*** 
 * @Author: Yuan Quan D
 * @Date: 2022-04-08 21:15:31
 * @LastEditTime: 2022-04-16 14:36:32
 * @LastEditors: Yuan Quan D
 * @FilePath: \Balance_Car\User_API\Inc\oled.h
 */

#ifndef _OLED_H_
#define _OLED_H_

#include "cmsis_os.h"
#include "main.h"
#include "delay.h"
//#include "intrins.h" //need to incluing the path of the intrins.h(keil c51 inc) c51 use only
//-----------------OLED端口定义---------------- 
//GPIOB, OLED_DO_Pin|OLED_D1_Pin|OLED_RES_Pin|OLED_DC_Pin

#define Oled_SCLH  HAL_GPIO_WritePin(GPIOB, OLED_DO_Pin, GPIO_PIN_SET)// 时钟定义 
#define Oled_SCLL  HAL_GPIO_WritePin(GPIOB, OLED_DO_Pin, GPIO_PIN_RESET)

#define Oled_SDAH  HAL_GPIO_WritePin(GPIOB, OLED_D1_Pin, GPIO_PIN_SET)//数据口D0
#define Oled_SDAL  HAL_GPIO_WritePin(GPIOB, OLED_D1_Pin, GPIO_PIN_RESET)

#define Oled_RSTH  HAL_GPIO_WritePin(GPIOB, OLED_RES_Pin, GPIO_PIN_SET)//复位低能电平
#define Oled_RSTL  HAL_GPIO_WritePin(GPIOB, OLED_RES_Pin, GPIO_PIN_RESET)

#define Oled_DCH   HAL_GPIO_WritePin(GPIOB, OLED_DC_Pin, GPIO_PIN_SET)
#define Oled_DCL   HAL_GPIO_WritePin(GPIOB, OLED_DC_Pin, GPIO_PIN_RESET)//偏置常低

//#define Oled_CSH   HAL_GPIO_WritePin(GPIOB, Oled_CS_Pin, GPIO_PIN_SET)
//#define Oled_CSL   HAL_GPIO_WritePin(GPIOB, Oled_CS_Pin, GPIO_PIN_RESET)//偏置常低

 extern void Oled_Init(void);
 extern void Oled_CLS(void);
 extern void Oled_Set_Pos(uint8_t x, uint8_t y);//设置坐标函数
 extern void Oled_PutPixel(uint8_t x,uint8_t y);//MIAO DIAN
 extern void Oled_Set_Pos_1(uint8_t x, uint8_t y,uint8_t bmp_data);
 extern void Oled_WrDat(uint8_t data);          //写数据函数
 extern void Oled_P6x8Char(uint8_t x,uint8_t y,uint8_t ch);
 extern void Oled_P6x8Str(uint8_t x,uint8_t y,uint8_t ch[]);
 extern void Oled_P8x16Str(uint8_t x,uint8_t y,uint8_t ch[]);
 extern void Oled_P14x16Str(uint8_t x,uint8_t y,uint8_t ch[]);
 extern void Oled_PXx16MixStr(uint8_t x, uint8_t y, uint8_t ch[]);
 extern void Oled_PrintBMP(uint8_t x0,uint8_t y0,uint8_t x1,uint8_t y1,uint8_t bmp[]); 
 extern void Oled_PrintImage(uint8_t *pucTable, uint16_t usRowNum, uint16_t usColumnNum);
 extern void Oled_Fill(uint8_t dat);
 extern void Oled_PrintValueC(uint8_t x, uint8_t y, int8_t data);
 extern void Oled_PrintValueI(uint8_t x, uint8_t y, int16_t data);
 extern void Oled_PrintValueF(uint8_t x, uint8_t y, float data, uint8_t num);
 extern void Oled_PrintEdge(void);
 extern void Oled_Cursor(uint8_t cursor_column, uint8_t cursor_row);
 extern void Oled_PrintLine(void);
 extern void Show_Team_Name(void);

#endif

